/**
 * \file XMLTextNode.h
 * \brief XMLTextNode declaration class
 * \author Edouard ROGE
 * \date 16 October 2012
 */

#ifndef _XML_TEXT_NODE_
#define _XML_TEXT_NODE_

#include "XMLNode.h"

namespace Core
{
	namespace File
	{
		/**
		 * \class XMLTextNode
		 * \brief Xml Node
		 */
		class XMLTextNode : public XMLNode
		{
		public:

			/**
			 * \fn XMLTextNode();
			 * \brief Default constructor
			 */
			XMLTextNode();

			/**
			 * \fn virtual ~XMLTextNode();
			 * \brief Destructor
			 */
			virtual ~XMLTextNode();

			/**
			 *\fn void SetText(const String & _strText);
			 *\param _strText text to set
			 *\brief Set new text
			 */
			void SetText(const std::string & _strText);

			/**
			 * \fn const String & GetText() const;
			 * \return String with the text node
			 * \brief Getter to the text of the node
			 */
			const std::string & GetText() const;

			/**
			 * \fn virtual error Save(File & _file) const;
			 * \param _file file to write in
			 * \return if success, returns errOK
			 * \brief Save in xml file
			 */
			virtual error Save(File & _file, uint32 _iDepth) const;

		private:

			/**
			 * text inside the node
			 */
			std::string m_strText;
		};
	}
}

#endif // _XML_TEXT_NODE_

